package com.homework.collections;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class test1 {
  public static void main(String[] args) {
    // 从控制台输入若干个单词（输入#结束）放入ArrayList中，将这些单词排序后（忽略大小写）打印出来。
    Scanner sc = new Scanner(System.in);
    ArrayList<String> arrayList = new ArrayList<>();
    for (int i = 0; i < 5; i++) {
      System.out.print("输入第" + (i + 1) + "个单词：");
      String s = sc.next();
      arrayList.add(s);
    }
    Collections.sort(arrayList);
    System.out.println(arrayList);
  }
}

